import groovy.xml.MarkupBuilder

StringWriter writer = new StringWriter()
MarkupBuilder viewBuilder = new MarkupBuilder(writer)

viewBuilder.html {
    head {
        title("My Page")
    }
    body {
        p("Put the table here:")
        table {
            tr('class':'highlight') {
                td("col1")
                td("col2")
            }
            tr {
                td("col1")
                td("col2")
            }
        }
    }
}

println writer
